Skip to content

feat: add attention state support for treeland task manager#1599

Draft
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:attention
Draft

feat: add attention state support for treeland task manager#1599
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:attention

Conversation

@18202781743
Copy link
Copy Markdown
Contributor

@18202781743 18202781743 commented May 15, 2026

  1. Bump treeland-protocols dependency to version > 0.5.7 to ensure
    protocol compatibility
  2. Use local protocol XML file instead of system-installed one for
    easier development and stability
  3. Add Attention state handling to TreeLandWindow, enabling taskbar to
    reflect window attention state
  4. Update wayland extension versions to v2 for both
    ForeignToplevelHandle and ForeignToplevelManager to utilize new protocol
    features
  5. Implement isAttention() method to check attention state from foreign
    toplevel handle

Log: Taskbar now supports treeland window attention state display

Influence:

  1. Test taskbar window entries show attention state (e.g., flashing/
    urgent) when window requests attention
  2. Verify normal window behavior without attention state remains
    unchanged
  3. Test with treeland compositor version > 0.5.7 to ensure protocol
    compatibility
  4. Verify backward compatibility with older treeland versions (if
    applicable)
  5. Test attention state reset when window gains focus or user interacts
    with taskbar entry

feat: 为treeland任务管理器添加注意力状态支持

  1. 将treeland-protocols依赖提升至>0.5.7版本以确保协议兼容性
  2. 使用本地协议XML文件替代系统安装的协议文件,便于开发和保持稳定性
  3. 为TreeLandWindow添加注意力状态处理,使任务栏能够反映窗口的注意力请求
  4. 将ForeignToplevelHandle和ForeignToplevelManager的wayland扩展版本更新
    至v2,以利用新协议特性
  5. 实现isAttention()方法,从foreign toplevel handle中检查注意力状态

Log: 任务栏现在支持treeland窗口注意力状态显示

Influence:

  1. 测试任务栏窗口条目在窗口请求注意力时显示注意力状态(如闪烁/紧急状态)
  2. 验证无注意力状态的窗口行为保持不变
  3. 使用treeland合成器版本>0.5.7测试,确保协议兼容性
  4. 验证与旧版本treeland的向后兼容性(如适用)
  5. 测试窗口获得焦点或用户与任务栏条目交互时注意力状态重置

Summary by Sourcery

Add support for Treeland window attention state in the dock task manager and update Treeland Wayland protocol integration.

New Features:

  • Expose an attention state for Treeland windows so the task manager can reflect when a window requests attention.

Enhancements:

  • Update Treeland foreign toplevel handle and manager Wayland extensions to version 2 to use newer protocol capabilities.
  • Reference a local Treeland foreign toplevel manager protocol XML in the task manager build configuration for more stable protocol generation.

Build:

  • Adjust CMake configuration to use a project-local Treeland protocol XML file for generating Wayland client sources.

1. Bump treeland-protocols dependency to version > 0.5.7 to ensure
protocol compatibility
2. Use local protocol XML file instead of system-installed one for
easier development and stability
3. Add Attention state handling to TreeLandWindow, enabling taskbar to
reflect window attention state
4. Update wayland extension versions to v2 for both
ForeignToplevelHandle and ForeignToplevelManager to utilize new protocol
features
5. Implement isAttention() method to check attention state from foreign
toplevel handle

Log: Taskbar now supports treeland window attention state display

Influence:
1. Test taskbar window entries show attention state (e.g., flashing/
urgent) when window requests attention
2. Verify normal window behavior without attention state remains
unchanged
3. Test with treeland compositor version > 0.5.7 to ensure protocol
compatibility
4. Verify backward compatibility with older treeland versions (if
applicable)
5. Test attention state reset when window gains focus or user interacts
with taskbar entry

feat: 为treeland任务管理器添加注意力状态支持

1. 将treeland-protocols依赖提升至>0.5.7版本以确保协议兼容性
2. 使用本地协议XML文件替代系统安装的协议文件,便于开发和保持稳定性
3. 为TreeLandWindow添加注意力状态处理,使任务栏能够反映窗口的注意力请求
4. 将ForeignToplevelHandle和ForeignToplevelManager的wayland扩展版本更新
至v2,以利用新协议特性
5. 实现isAttention()方法,从foreign toplevel handle中检查注意力状态

Log: 任务栏现在支持treeland窗口注意力状态显示

Influence:
1. 测试任务栏窗口条目在窗口请求注意力时显示注意力状态(如闪烁/紧急状态)
2. 验证无注意力状态的窗口行为保持不变
3. 使用treeland合成器版本>0.5.7测试,确保协议兼容性
4. 验证与旧版本treeland的向后兼容性(如适用)
5. 测试窗口获得焦点或用户与任务栏条目交互时注意力状态重置
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743 18202781743 marked this pull request as draft May 15, 2026 10:20
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 15, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds Treeland window attention state support in the dock task manager by updating the Treeland protocol usage, switching to a bundled XML protocol file, and wiring the new attention state into TreeLandWindow and its Wayland extensions.

Sequence diagram for Treeland attention state check in task manager

sequenceDiagram
    participant Taskbar
    participant TreeLandWindow
    participant ForeignToplevelHandle

    Taskbar->>TreeLandWindow: isAttention()
    TreeLandWindow->>ForeignToplevelHandle: state()
    ForeignToplevelHandle-->>TreeLandWindow:
    TreeLandWindow-->>Taskbar:
Loading

File-Level Changes

Change Details Files
Add attention state handling to TreeLandWindow and expose it via isAttention().
  • Extend the TreeLandWindow::State enum with an Attention value mapped to treeland_foreign_toplevel_handle_v1::state_attention.
  • Change TreeLandWindow::isAttention() from a hardcoded false return to querying the foreign toplevel handle state list for the Attention flag.
panels/dock/taskmanager/treelandwindow.h
panels/dock/taskmanager/treelandwindow.cpp
Update Wayland Treeland foreign toplevel client extensions to protocol version 2.
  • Bump ForeignToplevelHandle QWaylandClientExtensionTemplate version from 1 to 2 in its constructor.
  • Bump ForeignToplevelManager QWaylandClientExtensionTemplate version from 1 to 2 in its constructor.
panels/dock/taskmanager/treelandwindow.cpp
panels/dock/taskmanager/treelandwindowmonitor.cpp
Use a local Treeland foreign toplevel manager protocol XML instead of the system-installed one when generating Wayland client sources.
  • Point qt_generate_wayland_protocol_client_sources at a protocol XML under the taskmanager/protocol directory instead of TREELAND_PROTOCOLS_DATA_DIR.
panels/dock/taskmanager/CMakeLists.txt
Update copyright span for TreelandWindow source.
  • Extend the SPDX-FileCopyrightText year range to 2023-2026.
panels/dock/taskmanager/treelandwindow.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • TreeLandWindow::isAttention() assumes m_foreignToplevelHandle is always valid and ready; consider guarding against a null or not-yet-initialized handle to avoid potential crashes during startup or teardown.
  • Now that the foreign toplevel extensions request version 2, it would be good to explicitly handle the case where the compositor only supports v1 (e.g., by checking the advertised version or feature flags) to preserve backward compatibility described in the PR.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- TreeLandWindow::isAttention() assumes m_foreignToplevelHandle is always valid and ready; consider guarding against a null or not-yet-initialized handle to avoid potential crashes during startup or teardown.
- Now that the foreign toplevel extensions request version 2, it would be good to explicitly handle the case where the compositor only supports v1 (e.g., by checking the advertised version or feature flags) to preserve backward compatibility described in the PR.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@18202781743 18202781743 requested a review from wineee May 15, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants